package ar.edu.utn.frgp.TPFinalBanco.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity(name = "Transferencia")
public class Transferencia implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "idTransf")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer idTransf;
	
	@Column(name = "fecha")
	private Date fecha;
	
	@Column(name = "nroCtaOrigen", nullable=false)
	private Integer nroCtaOrigen;
	
	@Column(name = "nroCtaDestino", nullable=false)
	private Integer nroCtaDestino;
	
	@Column(name = "monto")
	private BigDecimal monto;

	public Integer getIdTransf() {
		return idTransf;
	}

	public void setIdTransf(Integer idTransf) {
		this.idTransf = idTransf;
	}

	public Date getFecha() {
		return fecha;
	}

	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}

	public Integer getNroCtaOrigen() {
		return nroCtaOrigen;
	}

	public void setNroCtaOrigen(Integer nroCtaOrigen) {
		this.nroCtaOrigen = nroCtaOrigen;
	}

	public Integer getNroCtaDestino() {
		return nroCtaDestino;
	}

	public void setNroCtaDestino(Integer nroCtaDestino) {
		this.nroCtaDestino = nroCtaDestino;
	}

	public BigDecimal getMonto() {
		return monto;
	}

	public void setMonto(BigDecimal monto) {
		this.monto = monto;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((idTransf == null) ? 0 : idTransf.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Transferencia other = (Transferencia) obj;
		if (idTransf == null) {
			if (other.idTransf != null)
				return false;
		} else if (!idTransf.equals(other.idTransf))
			return false;
		return true;
	}
	
	

}
